import Mock from 'mockjs'
const baseURL = 'http://localhost:8080'
// 设置随机
const Random1 = Mock.Random
// 设置全局延时，没有延时的话，有时候检测不到数据变化
Mock.setup({
  timeout: '300-600'
})
Mock.mock(baseURL + '/goodList', 'get', function () {
  return Mock.mock({
    'data|30': [
      {
        'id|+1': 1,
        'bianhao|1-500': 1,
        goodsImg: Random1.dataImage('50x50'),
        goddsTitle: {
          sj: '@csentence(6)',
          pinpai: 'Apple Inc.'
        },
        huohao: 'No999999',
        'biaoqian|1-2': true,
        'sku|1-100': 1,
        'xiaoliang|1-500': 1
      }
    ]
  })
  /*
  {
    'data|1-5': [
      {
        'id|+1': 1,
        'bianhao|1-500': 1,
        goodsImg: Random.dataImage(50 * 50),
        goddsTitle: {
          sj: '@csentence(6)',
          pinpai: 'Apple Inc.'
        },
        huohao: 'No999999',
        'biaoqian|1-2': true,
        'sku|1-100': 1,
        'xiaoliang|1-500': 1
      }
    ]
  } */
})
// 首页数据
Mock.mock(baseURL + '/systemsetup', 'get', {

  'shuj1|4': [
    {
      'count1|1-500': 1
    }
  ],
  shuj2: [
    {
      'count1|1-100': 1,
      name: '代付款订单'
    },
    {
      'count1|1-100': 1,
      name: '已完成订单'
    },
    {
      'count1|1-100': 1,
      name: '待确认退货订单'
    },
    {
      'count1|1-100': 1,
      name: '代发货订单'
    },
    {
      'count1|1-100': 1,
      name: '新缺货登记'
    },
    {
      'count1|1-100': 1,
      name: '待处理退款申请'
    },
    {
      'count1|1-100': 1,
      name: '已发货订单'
    },
    {
      'count1|1-100': 1,
      name: '待处理退货订单'
    },
    {
      'count1|1-100': 1,
      name: '广告位即将到期'
    }
  ]

})
// goodlist 商品列表数据
Mock.mock(baseURL + '/allgoods', 'get', {
  'res1': [
    {
      name: '全部商品',
      'goodCount|1-1000': 1
    },
    {
      name: '已上架',
      'goodCount|1-1000': 1
    },
    {
      name: '未上架',
      'goodCount|1-1000': 1
    },
    {
      name: '待审核',
      'goodCount|1-1000': 1
    },
    {
      name: '未通过',
      'goodCount|1-1000': 1
    }
  ]
})
Mock.mock(baseURL + '/addgoods', 'get', {
  'option|10': [
    {
      value: '@cname(2)',
      label: '@cname(2)',
      'children|10': [
        {
          value: '@cname(2)',
          label: '@cname(2)',
          'children|10': [
            {
              value: '@cname(2)',
              label: '@cname(2)'
            }
          ]
        }
      ]
    }
  ]
})
